<?php

/*****************************************************
 * Project: PPDAO
 * 
 * 
 * Author: Ivan Femia
 * Last modify by: Ivan Femia
 * 
 ***************************************************** 
 * 
 * Used to retrieve error messages
 * TODO: collect errors in an array in order to manage
 * in the view
 * 
 *****************************************************/

$sessionManager = SessionManager::getInstance();
$errors = $sessionManager->getFromSession("restricted_errors");

if ( $errors instanceof Errors ) {
	$iterator = $errors->getIterator();
	while($iterator->valid()) {
	    $error = $iterator->current();
		echo $error->getMessage()."</br>";
	    $iterator->next();
	}
}
?>